package com.example.logisticsingle.authorization;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * auth属性
 *
 */

@Component
@ConfigurationProperties(prefix = "auth")
@Data
public class AuthProperties {
    /**
     * 登录失败重试的时间（分）
     */
    public static long loginAfterTimeMinute=5;
    /**
     * 忽略认证的path
     */
    public static String path;
    /**
     * 限制用户登陆错误次数（次）
     */
    public static int maxLoginTimes=10;

    /**
     * 忽略的Urls
     */
    public static List<String> ignoredUrls;

    /**
     * Token
     */
    public static Token token=new Token();

    /**
     * Token属性
     * @author Roskin
     *
     */
    @Setter
    @Getter
    public static class Token{

        /**
         * header名称
         */
        public String header = "Authorization";
        /**
         * token前缀
         */
        public String prefix = "Bearer_";

        /**
         * 过期时间
         */
        public long expireTime = 7*24*60*60L;

        public int remembermeExpireTime = 7*60*60*24;

        public int cookieTime = 2*60*60;

    }
}
